package com.ljk.study10log4j2.controller;

import cn.hutool.log.Log;
import cn.hutool.log.LogFactory;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 * springboot的日志门面默认slfj
 * 底层spring的日志门面是采用Apache的common的日志门面
 * </p>
 *
 * @author ljk
 * @date 2021/4/12 20:16
 */
@RestController
@Slf4j
public class HelloController {

//    Log log = LogFactory.getLog(this.getClass());

    @GetMapping("/hi")
    public String sayHi() {
        log.info("测试日志,占位1[{}],占位2[{}]","我是1号","我是2号");
        return "{\"data\":\"请求成功\"}";
    }
}
